package com.xf.system.common.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xf.system.constants.DateConst;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.util.Date;

/**
 * @author xiefengf
 * @version 1.0
 * @date 2024/2/1 17:00
 */
@Schema(description = "用户信息表")
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("sys_user")
public class User extends BaseModel {

    @Schema(description = "用户账号")
    @TableField(value = "user_name")
    private String userName;

    @Schema(description = "密码")
    @TableField(value = "password")
    private String password;

    @Schema(description = "用户昵称")
    @TableField(value = "nick_name")
    private String nickName;

    @Schema(description = "用户类型（00系统用户）")
    @TableField(value = "user_type")
    private String userType;

    @Schema(description = "用户邮箱")
    @TableField(value = "email")
    private String email;

    @Schema(description = "手机号码")
    @TableField(value = "phone_number")
    private String phoneNumber;

    @Schema(description = "用户性别（0男 1女 2未知）")
    @TableField(value = "gender")
    private String gender;

    @Schema(description = "头像地址")
    @TableField(value = "avatar")
    private String avatar;

    @Schema(description = "帐号状态（0正常 1停用）")
    @TableField(value = "status")
    private String status;

    @Schema(description = "最后登录IP")
    @TableField(value = "login_ip")
    private String loginIp;

    @Schema(description = "最后登录时间")
    @JsonFormat(pattern = DateConst.SIMPLE, timezone = DateConst.TIME_ZONE_GMT8)
    @TableField(value = "login_date")
    private Date loginDate;

}
